std::forward_list::remove_if

From Cppreference

Jump to: navigation, search
template< class UnaryPredicate >
void remove_if( UnaryPredicate p );
(C++0x feature)

Removes all elements for which predicate p returns true from the container.

Contents

Parameters

p - unary predicate which returns ​true if the element should be removed.

The signature of the predicate function should be equivalent to the following:

bool pred(const Type &a);

The signature does not need to have const &, but the function must not modify the objects passed to it.
The type ​Type​ must be such that an object of type ​forward_list<T,Allocator>::const_iterator can be dereferenced and then implicitly converted to ​Type​. ​

Return value

(none)

Example

Complexity

linear in the size of the container

See also

remove
removes elements with specific value
(public member function)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages